package be.bonamis.umpire.domain;

import java.util.Collection;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;

@Entity
public class Club {
	
	private Integer id;
	private String code;
    private String name;
    private String dimaSportCode;
    private Integer number;    
    private Collection<Umpire> umpires;
    
    @Id 
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name="clubId")
    public Integer getId() {
        return id;
    }

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDimaSportCode() {
		return dimaSportCode;
	}

	public void setDimaSportCode(String dimaSportCode) {
		this.dimaSportCode = dimaSportCode;
	}

	public Integer getNumber() {
		return number;
	}

	public void setNumber(Integer number) {
		this.number = number;
	}
	
	public void setNumber(String number) {
		this.number = Integer.getInteger(number);				
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@OneToMany(mappedBy="club")
	public Collection<Umpire> getUmpires() {
		return umpires;
	}

	public void setUmpires(Collection<Umpire> umpires) {
		this.umpires = umpires;
	}

}
